<?php
namespace app\admin\controller;

use app\common\controller\AdminBaseController;
use app\common\enum\IsDelete;
use app\common\ext\IDb;
use app\common\ext\IRequest;
use think\Db;

class AgentAdminEvaluate extends AdminBaseController{
    /**
     * @功能：评价列表
     * @开发者：wdd
     * @return string
     */
    public function agent_admin_evaluate_list(){
        //接收参数
        $agent_admin_id = IRequest::get("agent_admin_id");
        $user_id = IRequest::get("user_id");
        $cooperate_admin_id = IRequest::get("cooperate_admin_id");

        $agent_admin_evaluate_where = null;
        if (!empty($agent_admin_id)) $agent_admin_favorite_where['agent_admin_id'] = $agent_admin_id;
        if (!empty($user_id)) $agent_admin_favorite_where['user_id'] = $user_id;
        if (!empty($cooperate_admin_id)) $agent_admin_favorite_where['$cooperate_admin_id'] = $cooperate_admin_id;
        $agent_admin_evaluate_list = IDb::getInstance('agent_admin_evaluate')
            ->setDbWhere($agent_admin_evaluate_where)
            ->setDbOrder('agent_admin_evaluate_id desc')
            ->pag();

        if($agent_admin_evaluate_list === false){
            error('获取评价列表失败');
        }

        //页面赋值
        $this->assign("agent_admin_evaluate_list",$agent_admin_evaluate_list);
        $this->assign("agent_admin_id",$agent_admin_id);
        $this->assign("user_id",$user_id);
        $this->assign("cooperate_admin_id",$cooperate_admin_id);

        //渲染模板输出
        return view();
    }
}